home *** CD-ROM | disk | FTP | other *** search
- package com.extensibility.dom;
-
- import java.io.EOFException;
- import java.io.IOException;
- import java.io.Writer;
-
- class FiniteWriter extends Writer {
- int maxChars;
- int writtenChars = 0;
- // $FF: renamed from: w java.io.Writer
- Writer field_0;
-
- FiniteWriter(Writer var1, int var2) {
- this.field_0 = var1;
- this.maxChars = var2;
- }
-
- public void write(char[] var1, int var2, int var3) throws IOException {
- if (var3 + this.writtenChars > this.maxChars) {
- var3 = this.maxChars - this.writtenChars;
- }
-
- if (var3 > 0) {
- this.field_0.write(var1, var2, var3);
- }
-
- this.writtenChars += var3;
- if (this.writtenChars >= this.maxChars) {
- throw new EOFException();
- }
- }
-
- public void flush() throws IOException {
- this.field_0.flush();
- }
-
- public void close() throws IOException {
- this.field_0.close();
- }
-
- public String toString() {
- return this.field_0.toString();
- }
- }
-